#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
int main()
{
	for (int i = 100; i <= 999; i++)
	{
		long long num = i * i;
		int c = num % 10;
		int b = num % 100;
		int b2 = b / 10;
		int a = num % 1000;
		int a2 = a / 100;
		if (a2 * 100 + b2 * 10 + c == i)
		{
			cout << i << endl;
		}
	}
	return 0;
}